{% block sw_maintain_currencies_modal %}
<sw-modal
    class="sw-maintain-currencies-modal"
    :title="$tc('sw-maintain-currencies-modal.title')"
    @modal-close="onCancel"
>

    {% block sw_maintain_currencies_modal_grid %}
    <sw-data-grid
        :data-source="currencyCollection"
        :columns="maintainCurrencyColumns"
        :show-selection="false"
        :compact-mode="false"
        :show-actions="false"
    >

        {% block sw_maintain_currencies_modal_grid_column_name %}
        <template
            #column-name="{ item }"
        >

            {% block sw_maintain_currencies_modal_grid_column_name_inherit_field %}
            <sw-inheritance-switch
                v-if="!item.isSystemDefault"
                class="sw-price-form__inherited-icon"
                :is-inherited="isCurrencyInherited(item)"
                @inheritance-restore="onInheritanceRestore(item.id)"
                @inheritance-remove="onInheritanceRemove(item)"
            />
            {% endblock %}

            {% block sw_maintain_currencies_modal_grid_column_name_item_name %}
            <p>{{ item.translated.name || item.name }}</p>
            {% endblock %}
        </template>
        {% endblock %}

        {% block sw_maintain_currencies_modal_grid_column_price %}
        <template #column-label-price>
            {% block sw_maintain_currencies_modal_grid_column_price_field_label %}
            <div class="sw-maintain-currencies-modal__price-label-wrapper">
                <div class="sw-maintain-currencies-modal__price-label">
                    {{ $tc('sw-maintain-currencies-modal.columnPrice') }}
                </div>
                <div
                    v-if="!hideListPrices"
                    class="sw-maintain-currencies-modal__list-price-label"
                >
                    {{ $tc('sw-maintain-currencies-modal.columnListPriceHeader') }}
                </div>
                <div
                    v-if="!hideRegulationPrices"
                    class="sw-maintain-currencies-modal__reference-price-label"
                >
                    {{ $tc('sw-maintain-currencies-modal.columnReferencePriceHeader') }}
                </div>
            </div>
            {% endblock %}
        </template>

        <template
            #column-price="{ item }"
        >
            {% block sw_maintain_currencies_modal_grid_column_price_field %}
            <sw-list-price-field
                :price="prices"
                :default-price="defaultPrice"
                :tax-rate="taxRate"
                :label="false"
                :disable-suffix="true"
                :hide-list-prices="hideListPrices"
                :hide-regulation-prices="hideRegulationPrices"
                hide-purchase-prices
                :disabled="disabled"
                enable-inheritance
                :currency="item"
            />
            {% endblock %}
        </template>
        {% endblock %}
    </sw-data-grid>
    {% endblock %}

    {% block sw_maintain_currencies_modal_footer %}
    <template #modal-footer>

        {% block sw_maintain_currencies_modal_footer_button_cancel %}
        <mt-button
            size="small"
            variant="secondary"
            @click="onCancel"
        >
            {{ $tc('global.default.cancel') }}
        </mt-button>
        {% endblock %}

        {% block sw_maintain_currencies_modal_footer_button_apply %}
        <mt-button
            variant="primary"
            size="small"
            @click="onApply"
        >
            {{ $tc('global.default.apply') }}
        </mt-button>
        {% endblock %}
    </template>
    {% endblock %}
</sw-modal>
{% endblock %}
